﻿using AutoMapper;
using TR.AppService.AppService.Bs_warehouse;
using TR.Domain.Entity;
using TR.Domain.Repository.Bs_warehouseRepostiory;
using TR.Domain.Repository.sqlDto;

namespace TR.AppService.AppService.bs_warehouse
{
    public class bs_warehouseService : IBs_warehouseService
    {
        private readonly IMapper mapper;
        private readonly Ibs_warehouseRepostiory ibs_WarehouseRepostiory;
        public bs_warehouseService(IMapper mapper, Ibs_warehouseRepostiory ibs_WarehouseRepostiory)
        {
            this.mapper = mapper;
            this.ibs_WarehouseRepostiory = ibs_WarehouseRepostiory;
            } 

        public Task<FenYe<bs_WareHouse>> bs_Item_FenYe(int pageSize, int currentPage, string str)
        {
            return ibs_WarehouseRepostiory.warehouse_FenYe(pageSize, currentPage, str);
        }

        public Task<bool> ItemAdd(bs_WareHouse bs_Ware)
        {
            return ibs_WarehouseRepostiory.warehouseAdd(bs_Ware);
        }

        public Task<bool> ItemDelect(int id)
        {
            return ibs_WarehouseRepostiory.warehouseUDelect(id);
        }

        public Task<bs_WareHouse> ItemSelectCode(string ware_code)
        {
            return ibs_WarehouseRepostiory.ItemSelectCode(ware_code);
        }

        public Task<bs_WareHouse> ItemSelectid(int id)
        {
            return ibs_WarehouseRepostiory.warehouseSelectid(id);
        }

        public Task<bs_WareHouse> ItemSelete(int id)
        {
            return ibs_WarehouseRepostiory.warehouseSelete(id);
        }

        public Task<bool> ItemUpdate(bs_WareHouse uid)
        {
            return ibs_WarehouseRepostiory.ItemUpdate(uid);
        }

        public async Task<bool> KWUpdate(List<int> id, string warecode)
        {
            return await ibs_WarehouseRepostiory.KWUpdate(id, warecode);
        }
    }
}
